MPT.addTmpl('friend', function(_data) {

    var html = [];

    html.push('<div class="contenter flw clrfix" id="contenter">');
    html.push('<div class="mpt a_friend">');
    html.push('	<div class="leftside">');
    html.push('    	<input class="search e_search" type="text" value="搜索好友..." />');
    html.push('        <h2 class="tel" title="好友分组">好友分组</h2>');
    html.push('        <div class="list e_group_list">');
    html.push('        	   <a href="javascript:;" title="全部好友"><em class="nub">0</em><span>全部好友</span></a>');
    html.push('            <a href="javascript:;" title="未分组好友"><em class="nub">0</em><span>未分组好友</span></a>');
    html.push('        </div>');
    html.push('    </div>');
    html.push('    <div class="rightside">');
    html.push('    	<div class="subnav_box clrfix">');
    html.push('            <ul class="subnav">');
    html.push('                <li class="e_create_group" title="创建分组">创建分组</li>');
    html.push('                <li class="btn_off e_edit_group" title="编辑分组">编辑分组</li>');
    html.push('                <li class="btn_off e_del_group" title="删除分组">删除分组</li>');
    html.push('            </ul>');
    html.push('        </div>');
    html.push('        <div class="title_box clrfix">');
    html.push('            <div class="sort">');
    html.push('                <strong class="name e_sort" title="好友排序">好友排序');
    html.push('                    <div class="sort_list e_sort_list">');
    html.push('                        <a href="javascript:;" order="1" class="on" title="社区等级">社区等级</a>');
    html.push('                        <a href="javascript:;" order="2" title="最后登录时间">最后登录时间</a>');
    html.push('                        <a href="javascript:;" order="3" title="在线状态">在线状态</a>');
    html.push('                    </div>');
    html.push('                </strong>');
    html.push('            </div>');
    html.push('            <strong class="title e_title">全部好友</strong>');
    html.push('        </div>');
    html.push('        <div class="people_list e_friend_list">');
    html.push('        </div>');
    html.push('    	   <div class="attention">');
    html.push('            <div class="paging e_page">');
    html.push('            </div>');
    html.push('        </div>');
    html.push('    </div>');
    html.push('</div>');
    html.push('</div>');

    return html.join('');
});


MPT.addTmpl('one_group', function(_data) {

    var html = [];

    html.push('<a href="javascript:;" gid="' + _data.groupID + '" title="' + _data.groupName + '">');
    html.push('<em class="nub">' + _data.counts + '</em>');
    html.push('<span>' + _data.groupName + '</span></a>');

    return html.join('');
});


MPT.addTmpl('one_friend', function(_data) {

    var html = [];

    var uid = _data.uid;
    var nickname = _data.nickname;
    var shield_status = Boolean(_data.shieldStatus);
    var is_online = Boolean(_data.online);
    var group_name = _data.groupName;
    var group_id = _data.groupID;
    var sysTime = _data.sysTime;
    var lastLoginTime = _data.lastLoginTime;
    var unlog_time = Util.unlogTime(sysTime, lastLoginTime);
    var grade = Util.transformGradeToIcon(_data.grade);

    var space_path = Util.spacePath(uid);
    var image_path = Util.avatarPath(uid, 33);

    var online_icon = is_online ? "online" : "";
    var shield_icon = shield_status ? "no" : "none";
    var shield_hint = shield_status ? "取消屏蔽" : "屏  蔽";
    var shield_type = shield_status ? 1 : 0;
    var display_gname = group_name.contains("未分组") ? "" : group_name;

    html.push('<dl class="people e_people" id="' + uid + '" nick="' + nickname + '">');
    html.push('    <dt class="head">');
    html.push('        <a href="' + space_path + '">');
    html.push('            <img src="' + image_path + '" alt="">');
    html.push('            <strong class="status ' + shield_icon + ' e_sh_icon"></strong>');
    html.push('        </a>');
    html.push('    </dt>');
    html.push('    <dd class="content">');
    html.push('        <ul class="btn_box">');
    html.push('            <li><a class="shield e_shield" type="' + shield_type + '"> ' + shield_hint + '</a></li>');
    html.push('            <li class="e_group_manage">');
    html.push('            </li>');
    html.push('            <li><a class="close e_close" href="javascript:;" title="删除"></a></li>');
    html.push('        </ul>');
    html.push('        <h2 class="name_box ' + online_icon + '"><a class="name" href="' + space_path + '" title="' + nickname + '">' + nickname + '<em>【电信一区-傲视天下】</em></a></h2><!-- 状态为亮的话加上online否的删除 -->');
    html.push('        <p class="info">' + display_gname + '</p>');
    html.push('        <p class="grade">' + grade + '<strong class="time">' + unlog_time + '</strong></p>');
    html.push('    </dd>');
    html.push('</dl>');

    return html.join('');
});

